package ru.aptu.gsp_banking.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "accounts")
public class Account {

    /*
    id int not null auto_increment primary key,
    account_number varchar(20) not null,
    balance float not null,
    currency char(3) not null,
    username varchar(50) not null,
     */

	@Id
	@Column(name = "id")
	@GeneratedValue
	private Integer id;

    @Column(name = "account_number")
	private String accountNumber;

    @Column(name = "balance")
	private float balance;

	@Column(name = "currency")
	private String currency;

	@Column(name = "username")
	private String username;

    public String getFullName() {
        return "№ " + accountNumber + "\t\tBalance: " + (new Float(balance)).toString() + " " + currency;
    }

    public String getAccountNumber() {
        return accountNumber;
    }

    public void setAccountNumber(String accountNumber) {
        this.accountNumber = accountNumber;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public float getBalance() {
        return balance;
    }

    public void setBalance(float balance) {
        this.balance = balance;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}
